<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>修改人员信息</title>
    <link rel="shortcut icon" href="favicon.ico"> <link href="__PUBLIC__/Theme1/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="__PUBLIC__/Theme1/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <link href="__PUBLIC__/Theme1/css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="__PUBLIC__/Theme1/css/animate.min.css" rel="stylesheet">
    <link href="__PUBLIC__/Theme1/css/style.min.css?v=4.1.0" rel="stylesheet">
    <link href="__PUBLIC__/Theme1/static/plupload/upfiless.css" rel="stylesheet" type="text/css" />
    <link href="__PUBLIC__/Theme1/lib/webuploader/0.1.5/webuploader.css" rel="stylesheet" type="text/css" />
    <link href="__PUBLIC__/Theme1/css/plugins/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css" rel="stylesheet">

    <link href="__PUBLIC__/Theme1/css/newstyle.css" rel="stylesheet">
</head>

<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>修改人员信息 <a style="margin-left: 15px; color:#06cbc4" href="__URL__/lists">返回列表</a></h5>
                        <div class="ibox-tools">
                            
                        </div>
                    </div>
                    <div class="ibox-content">
                        <form method="post" action="__URL__/UpdateAction/stId/<{$rs_staffInfo.stId}>" class="form-horizontal" id="form-admin-add" enctype="multipart/form-data" >
                            <div class="form-group">
                                 <label class="col-sm-1 control-label">姓名</label>
                                <div class="col-sm-3">
                                    <input type="text" name="stName" value="<{$rs_staffInfo.stName}>" id="stName" class="form-control">
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-1 control-label">民族</label>
                                <div class="col-sm-3">
                                    <select class="chosen-select form-control" size="1" name="stMultiracial" id="stMultiracial" required>
                                        <option value="">请选择民族</option>
                                        <foreach name="minzu" item="valminzu" key="minzuk">
                                            <option value="<{$minzuk}>"    <if condition="$rs_staffInfo.stMultiracial eq $minzuk">selected = "selected"</if>><{$valminzu}></option>
                                        </foreach>
                                    </select>
                                </div>

                                <label class="col-sm-1 control-label">民语姓名</label>
                                <div class="col-sm-3">
                                    <input type="text" name="nationNanme" id="nationNanme" value="<{$rs_staffInfo.nationNanme}>" placeholder="请输民语姓名" class="form-control">
                                </div>

                            </div>

                            <div class="form-group">
                                <label class="col-sm-1 control-label">电话</label>
                                <div class="col-sm-3">
                                    <input type="text" name="stTel" id="stTel" value="<{$rs_staffInfo.stTel}>" class="form-control">
                                </div>

                                <label class="col-sm-1 control-label">性别</label>
                                <php>
                                $sex_1=1;
                                $sex_2=2;
                                $checked="";
                                $checkedss="";
                                if($rs_staffInfo["stSex"]==$sex_1){
                                    $checked="checked";
                                }else{
                                    $checkedss="checked";
                                    }
                                </php>
                                <div class="col-sm-3">
                                    <label class="checkbox-inline">
                                        <input type="radio" name="stSex" value="<{$sex_1}>" <{$checked}>> 男</label>
                                    <label class="checkbox-inline">
                                        <input type="radio" value="<{$sex_2}>" name="stSex" <{$checkedss}>> 女</label>
                                </div>

                            </div>



                            <div class="form-group">
                                <label class="col-sm-1 control-label">所属地区</label>
                                <div class="col-sm-7" >
                                    <select class="selectRegione"  name="regione1" >
                                        <php>
                                            if(count($regione1)!=1){
                                        </php>
                                        <option value="0">请选择</option>
                                        <php>}</php>
                                        <foreach name="regione1" item="valregione" key="regionek">
                                            <option value="<{$valregione.id}>" ><{$valregione.name}></option>
                                        </foreach>
                                    </select>

                                    <select class="selectRegione"  name="regione2" <php>if(empty($regione2)){</php>style="display: none"<php>}</php> >
                                        <php>
                                            if(count($regione2)!=1){
                                        </php>
                                        <option value="0">请选择</option>
                                        <php>}</php>
                                        <foreach name="regione2" item="valregione" key="regionek">
                                            <option value="<{$valregione.id}>" ><{$valregione.name}></option>
                                        </foreach>
                                    </select>

                                    <select class="selectRegione"  name="regione3"  <php>if(empty($regione3)){</php>style="display: none"<php>}</php>>
                                        <php>
                                            if(count($regione3)!=1){
                                        </php>
                                        <option value="0">请选择</option>
                                        <php>}</php>
                                        <foreach name="regione3" item="valregione" key="regionek">
                                            <option value="<{$valregione.id}>" ><{$valregione.name}></option>
                                        </foreach>
                                    </select>
                                    <select class="selectRegione"  name="regione4" <php>if(empty($regione4)){</php>style="display: none"<php>}</php> >
                                        <php>
                                            if(count($regione4)!=1){
                                        </php>
                                        <option value="0">请选择</option>
                                        <php>}</php>
                                        <foreach name="regione4" item="valregione" key="regionek">
                                            <option value="<{$valregione.id}>" ><{$valregione.name}></option>
                                        </foreach>
                                    </select>
                                    <!--小组-->
                                    <select class="selectRegione"  name="xiaozu" <php>if(empty($xiaozulist)){</php>style="display: none"<php>}</php> >
                                        <option value="" selected>请选择</option>
                                        <foreach name="xiaozulist" item="val" key="key">
                                            <option value="<{$val.dId}>" ><{$val.dName}></option>
                                        </foreach>
                                    </select>
                                </div>

                            </div>


                            <div class="form-group">
                                <label class="col-sm-1 control-label">房屋编号</label>
                                <div class="col-sm-3">
                                    <input type="text" name="maisonNum" id="maisonNum"  value="<{$rs_staffInfo.maisonNum}>" class="form-control">
                                </div>

                                <label class="col-sm-1 control-label">身份证号码</label>
                                <div class="col-sm-3">
                                    <input type="text" name="stIDCard" value="<{$rs_staffInfo.stIDCard}>" id="stIDCard" class="form-control">
                                </div>

                                

                            </div>

                        
                                
                            <div class="hr-line-dashed"></div>
                            <div class="form-group">
                                <div class="col-sm-4 col-sm-offset-2">
                                    <button class="btn btn-primary" type="submit">修改人员信息</button>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script src="__PUBLIC__/Theme1/js/jquery.min.js?v=2.1.4"></script>
    <script src="__PUBLIC__/Theme1/js/bootstrap.min.js?v=3.3.6"></script>
    <script src="__PUBLIC__/Theme1/js/content.min.js?v=1.0.0"></script>
    <script src="__PUBLIC__/Theme1/js/plugins/iCheck/icheck.min.js"></script>

<script type="text/javascript" src="__PUBLIC__/Theme1/check/js/jquery.validate.min.js"></script> 

<script type="text/javascript" src="__PUBLIC__/Theme1/check/js/messages_zh.min.js"></script> 

<script type="text/javascript" src="__PUBLIC__/Theme1/check/js/validate-methods.js"></script> 
<script type="text/javascript" src="__PUBLIC__/Theme1/lib/webuploader/0.1.5/webuploader.min.js"></script> 

    <script>
        $(document).ready(function(){$(".i-checks").iCheck({checkboxClass:"icheckbox_square-green",radioClass:"iradio_square-green",})});
    </script>
    
    <script type="text/javascript">
	$(function(){
	$("#form-admin-add").validate({
		rules:{
            stNum:{
                required:true,
                minlength:1,
                maxlength:8
            },
            stName:{
                required:true,
                minlength:2,
                maxlength:16
            },
            stSex:{
                required:true,
            },
            stBirthdate:{
                required:true,
            },
            sCompanyIntroduce:{
                required:true,
            },
            stTel:{
                required:true,
                minlength:7,
                maxlength:11
            },
           
            
            
        },
		onkeyup:false,
		focusCleanup:true,
		success:"valid",
		submitHandler:function(form){
			$(form).ajaxSubmit();
			var index = parent.layer.getFrameIndex(window.name);
			parent.$('.btn-refresh').click();
			parent.layer.close(index);
		}
	});
});
</script> 
    
<script type="text/javascript" src="__PUBLIC__/Theme1/static/plupload/plupload.full.min.js"></script>
<script type="text/javascript">
            var uploader = new plupload.Uploader(
                  {
                    runtimes: 'html5,flash,silverlight,html4', //上传插件初始化选用那种方式的优先级顺序
                    browse_button: 'btn', // 上传按钮
                    url: "__URL__/up", //远程上传地址
                    flash_swf_url: '__PUBLIC__/plupload/Moxie.swf', //flash文件地址
                    silverlight_xap_url: '__PUBLIC__/plupload/Moxie.xap', //silverlight文件地址
                    filters: {
                        max_file_size: '2mb', //最大上传文件大小（格式100b, 10kb, 10mb, 1gb）
                        mime_types: [//允许文件上传类型
                            {title: "files", extensions: "jpg,png,gif"}
                        ]
                 },
                multi_selection: true, //true:ctrl多文件上传, false 单文件上传
                init: {
                    FilesAdded: function(up, files) { //文件上传前
                        if ($("#ul_pics").children("li").length >7) {
                            alert("您上传的图片太多了！");
                            uploader.destroy();
                        } else {
                            var dd = '';
                            plupload.each(files, function(file) { //遍历文件
                                dd += "<dd id='" + file['id'] + "'><div class='progress'><span class='bar'></span><span class='percent'>0%</span></div></dd>";
                            });
                            $("#ul_pics").append(dd);
                            uploader.start();
                        }
                    },
                    UploadProgress: function(up, file) { //上传中，显示进度条
                 var percent = file.percent;
                        $("#ul_pics" + file.id).find('.bar').css({"width": percent + "%"});
                        $("#ul_pics" + file.id).find(".percent").text(percent + "%");
                    },
                    FileUploaded: function(up, file, info) { //文件上传成功的时候触发
                       var data = eval("(" + info.response + ")");
                        $("#" + file.id).html("<img src='__ROOT__/" + data.pic + "'/>");
                        var old=$("#pPic").val();
                         $("#pPic").val(old + data.pic+'###');
                    },
                    Error: function(up, err) { //上传出错的时候触发
                        alert(err.message);
                    }
                }
            });
            uploader.init();
        </script>


    <SCRIPT type="text/javascript">
        $(function(){

            //当第一个选择时，给第二填充数据
            $("[name='regione1']").change(function(){
                $("[name='regione2']").html('<option value="0">加载中...</option>');
                var id=$(this).val();
                var html='<option value="0">请选择</option>';
                $.ajax({    //ajax方法获取选定区域的下级区域列表
                    url:"/Personnelsystem/Department/getChildId",
                    data:{id:id},
                    dataType:'json',
                    type:'post',
                    success:function(re){
                        var html='<option value="0">请选择</option>';
                        var item=re;
                        for(var i in item){
                            html +='<option value="'+item[i]['id']+'" >'+item[i]['name']+'</option>';
                        }
                        $("[name='regione2']").html(html);
                        $("[name='regione2']").show();
                    }
                })
            });
            //当第2个选择时，给第3填充数据
            $("[name='regione2']").change(function(){
                $("[name='regione3']").html('<option value="0">加载中...</option>');
                var id=$(this).val();
                var html='<option value="0">请选择</option>';
                $.ajax({    //ajax方法获取选定区域的下级区域列表
                    url:"/Personnelsystem/Department/getChildId",
                    data:{id:id},
                    dataType:'json',
                    type:'post',
                    success:function(re){
                        var html='<option value="0">请选择</option>';
                        var item=re;
                        for(var i in item){
                            html +='<option value="'+item[i]['id']+'" >'+item[i]['name']+'</option>';
                        }
                        $("[name='regione3']").html(html);
                        $("[name='regione3']").show();
                    }
                })
            });
            //当第3个选择时，给第4填充数据
            $("[name='regione3']").change(function(){
                $("[name='regione4']").html('<option value="0">加载中...</option>');
                var id=$(this).val();
                var html='<option value="0">请选择</option>';
                $.ajax({    //ajax方法获取选定区域的下级区域列表
                    url:"/Personnelsystem/Department/getChildId",
                    data:{id:id},
                    dataType:'json',
                    type:'post',
                    success:function(re){
                        var html='<option value="0">请选择</option>';
                        var item=re;
                        for(var i in item){
                            html +='<option value="'+item[i]['id']+'" >'+item[i]['name']+'</option>';
                        }
                        $("[name='regione4']").html(html);
                        $("[name='regione4']").show();
                    }
                })
            });

            //当选择村时，获取组信息
            $("[name='regione4']").change(function(){
                $("[name='xiaozu']").html('<option value="0">加载中...</option>');
                var id=$(this).val();
                var html='<option value="0">请选择</option>';
                $.ajax({    //ajax方法获取选定区域的下级区域列表
                    url:"__URL__/getxiaozuInfo",
                    data:{id:id},
                    dataType:'json',
                    type:'post',
                    success:function(re){
                        var html='<option value="0">请选择</option>';
                        var item=re;
                        for(var i in item){
                            html +='<option value="'+item[i]['dId']+'" >'+item[i]['dName']+'</option>';
                        }
                        $("[name='xiaozu']").html(html);
                        $("[name='xiaozu']").show();
                    }
                })
            });
        })

    </SCRIPT>
</body>

</html>
